var t = getApp();
Component({
  properties: {},
  data: { extra: {}, CONFIG: {} },
  lifetimes: {
    attached: function () {
      this.setData({
        extra: wx.getStorageSync('user').extra || {},
        CONFIG: t.CONFIG,
      });
    },
  },
  methods: {
    _refresh: function () {
      this.setData({ extra: wx.getStorageSync('user').extra || {} }),
        console.log(
          '触发了关注公众号组件的刷新：',
          !this.data.extra.wx_subscribe,
        );
    },
    go: function () {
      var e = this.data.extra.wx_config;
      e.url
        ? wx.navigateTo({
            url: '/pages/webview/webview?pure='.concat(
              encodeURIComponent(e.url),
            ),
          })
        : wx.showModal({
            title: '如何关注公众号？',
            content: '请前往微信搜索【'.concat(
              t.CONFIG.SHORT_NAME,
              '】进行关注',
            ),
          });
    },
  },
});
